#include "crecipeingredient.h"

using namespace cooking;

CRecipeIngredient::CRecipeIngredient(QObject *parent) :
    CObject(parent)
{
//    m_id = KInvalidId;
    m_quantity = 0.0;
    m_recipe_id = KInvalidId;
    m_ingredient_id = KInvalidId;
    m_custom_quantity = 0.0;
    m_custom_unit_type_id = KInvalidId;
}

//int CRecipeIngredient::id() {
//    return m_id;
//}

//void CRecipeIngredient::setId(int id) {
//    if (m_id != id) {
//        m_id = id;
//        emit idChanged();
//    }
//}

int CRecipeIngredient::ingredientId() {
    return m_ingredient_id;
}

void CRecipeIngredient::setIngredientId(int ingredientId) {
    if (m_ingredient_id != ingredientId) {
        m_ingredient_id = ingredientId;
        emit ingredientIdChanged();
    }
}

int CRecipeIngredient::recipeId() {
    return m_recipe_id;
}

void CRecipeIngredient::setRecipeId(int recipeId) {
    if (m_recipe_id != recipeId) {
        m_recipe_id = recipeId;
        emit recipeIdChanged();
    }
}

double CRecipeIngredient::quantity() {
    return m_quantity;
}

void CRecipeIngredient::setQuantity(double quantity) {
    if (m_quantity != quantity) {
        m_quantity = quantity;
        emit quantityChanged();
    }
}

double CRecipeIngredient::customQuantity() {
    return m_custom_quantity;
}

void CRecipeIngredient::setCustomQuantity(double quantity) {
    if (m_custom_quantity != quantity) {
        m_custom_quantity = quantity;
        emit customQuantityChanged();
    }
}

int CRecipeIngredient::customUnitTypeId() {
    return m_custom_unit_type_id;
}

void CRecipeIngredient::setCustomUnitTypeId(int unitTypeId) {
    if (m_custom_unit_type_id != unitTypeId) {
        m_custom_unit_type_id = unitTypeId;
        emit customUnitTypeIdChanged();
    }
}
